<extend name="Base:base" />
<block name="base_main">
	<link rel="stylesheet" href="__PUBLIC__/seller/css/validform.css" />
	<script src="__PUBLIC__/seller/js/Validform_v5.3.2.js"></script>
	<style>
		body{ background:#fff }
	</style>
	<div class="tpl-block ">
		<div class="am-g tpl-amazeui-form">
			<div class="am-u-sm-12 am-u-md-11">
			    <style>
                                .pay_ment_info{ width:80%; font-size:16px;  }
                                .pay_ment_info dl dt{ width:100%; height:40px; line-height:40px; font-size:16px; border-bottom:1px solid #ccc; text-indent:10px;}
                                .pay_ment_info dl dd{ float:left; line-height:220%; width:100%; text-indent:20px; color:#666 }
                                .pay_ment_info dl dd span{ color:#333; }
                            </style>
                  
                            <div class="pay_ment_info">
                                <dl>
                                	<dd style="width:100%"><span style="float:left">商品名称：</span><span style="float:left; width:300px;">{$ref.name}</span></dd>
                                    <?php $receive_info = explode('|' , $ref['receive_info']); ?>
                                    <dd><span>收货人：</span>{$receive_info[0]}</dd>
                                    <dd><span>联系电话：</span>{$receive_info[2]}</dd>
                                    <dd><span>收货地址：</span>{$receive_info[3]}{$receive_info[4]}{$receive_info[5]}{$receive_info[6]}{$receive_info[7]}</dd>
                                    <dd><span>快递名称：</span>
                                     <select id="send_id" name="send_id">
                                           <volist name="send_types" id="val">
                                            <option value="{$val}">{$val}</option>
                                           </volist>
                                       
                                     </select>
                                    </dd>
                                    <dd><span>快递单号：</span> <input type="text" style=" padding:4px 10px; border:1px solid #ccc;" name="send_num"  id="send_num" placeholder="快递单号"></dd>
                                </dl>
                            </div>
                            <div class="am-u-sm-5 am-u-sm-push-4" style="margin-top:50px;">
                                <button type="button" id="submit_send" class="am-btn am-btn-primary" >发货</button>
                            </div>
			</div>
		</div>
	</div>
        <script>
                $('#submit_send').click(function(){
					var ref = "{$Think.get.ref}";
					var express_name = $("#send_id option:selected").val();
					var express_no;
					if( express_name != '' ){
						express_no = $("#send_num").val();
						if(express_no == ''){
							alert('请输入物流单号');
							return;
						}
					}
					$.post("{:U('send')}",{express_name:express_name,express_no:express_no,ref:ref},function(data){
						if(data.errno==1){
							alert(data.error);
							parent.window.send_notify();
						}else{
							alert(data.error);
						}
					},'json');
				
				
				});
        </script>
</block>